﻿@model Windvoice.Blog.Friend

@{
    ViewBag.Title = "Friend Edit";
    Layout = "~/Areas/Manage/Views/Shared/_Layout.cshtml";
}

@section headSection{
    <script src="@Url.Content("~/Content/js/jquery.validate.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Content/js/jquery.validate.unobtrusive.js")" type="text/javascript"></script>
}

<div class="pagetitle">
    <h2>编辑好友链接</h2>
    <div class="pagefunctions">
        @Html.ActionLink("返回列表", "index")
    </div>    
</div>

@using (Html.BeginForm("edit", "friend", FormMethod.Post, new { @class = "dataform", enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>好友信息</legend>

        @Html.HiddenFor(model => model.ID)
        
        <div class="editor-label">
            @Html.LabelFor(model => model.Name)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Portrait)
        </div>
        <div class="editor-field">
            <p><img src="@Model.Portrait" width="160" height="90" /></p>
            @Html.TextBoxFor(model => model.Portrait, new { type="file"})
            @Html.ValidationMessageFor(model => model.Portrait)
        </div>
        
        <div class="editor-label">
            @Html.LabelFor(model => model.LinkUrl)
        </div>
        <div class="editor-field">
            @Html.TextBoxFor(model => model.LinkUrl, new {@class="long"})
            @Html.ValidationMessageFor(model => model.LinkUrl)
        </div>

        <p>
            <input class="submitbutton" type="submit" value="提交" />
        </p>
    </fieldset>
}